﻿@page "/DataCenter/DBConn"
@attribute [TabItemOption(Text = "数据连接")]
@inherits ComponentBaseDataCenter
<PageTitle>数据连接</PageTitle>


<h3>数据连接</h3>

<Table TItem="DBConnPageVO" UseInjectDataService="false" IsPagination="true" PageItemsSource="PageItems"
       IsStriped="true" IsBordered="true" ShowSkeleton="true" IsMultipleSelect="true" ShowEmpty="true"  ShowLoading="true" ShowColumnList="true" 
       ShowToolbar="true" ShowExtendButtons="false"
       ShowSearch="true" ShowAdvancedSearch="false" 
       AutoGenerateColumns="true" EditMode="EditMode.Popup"
       OnQueryAsync="QueryAsync" OnSaveAsync="@OnSaveAsync" OnDeleteAsync="OnDeleteAsync" ShowToastAfterSaveOrDeleteModel="false">
       <EditTemplate>
            <div class="row g-3 form-inline">
                <div class="col-12 col-sm-6">
                    <BootstrapInput @bind-Value="@context.name" placeholder="不可为空，50字以内" maxlength="50" />
                </div>
                @*<div class="col-12 col-sm-6">
                    <Select @bind-Value="@context.type" placeholder="不可为空，50字以内" />
                </div>*@
                <div class="col-12 col-sm-6">
                <BootstrapInput @bind-Value="@context.database" OnValueChanged="@((x)=>OnDatabaseValueChangedAsync(@context))" />
                </div>
                <div class="col-12 col-sm-6">
                    <BootstrapInput @bind-Value="@context.host" />
                </div>
            </div>
        </EditTemplate>
    @*<TableColumns>
    <TableColumn @bind-Field="@context.Hobby" Items="GetHobbys(context)" />
    </TableColumns>*@
</Table>